package springmvcdemo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/con2")
@RestController
public class Controller2 {
    @RequestMapping("/test1")
    public String Test1(String s) {
        return "传递单个参数成功,参数是："+s;
    }
    @RequestMapping("/test2")
    public String test2(int x) {
        return "我是普通类型参数："+x;
    }
    @RequestMapping("/test3")
    public String test3(Integer x,String s,Character ch) {
        return "整数：" +x + "字符串："+s + "字符："+ch;
    }
    @RequestMapping("/test4")
    public String test4(@RequestParam(value = "userName",required = false) String user, String password) {
        return "user:"+user+" password:"+password;
    }




}
